<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑</title>
    <link rel="stylesheet" href="../css/edit.css" type="text/css">
    <script src="../jQuery/jquery-3.3.1.js"></script>

    <script src="../jQuery/jquery-3.3.1.js"></script>

    <script src="../js/jquery-2.1.1.min.js"></script>
    <script src="../js/jquery.form.min.js"></script>
    <script src="../js/main.js"></script>
    <script src="../layer/layer.js"></script>

    <script>
        $.ajaxSetup({
            xhrFields: {
                withCredentials: isCrossDomain
            }
        });
        $(function () {
            var options = {
                // 规定把请求发送到那个URL
                url: mainurl+"admin/updataAchievement",
                // 请求方式
                type: "post",
                // 服务器响应的数据类型
                dataType: "json",
                beforeSubmit: function (formData, jqForm, options) {
                    for(i=0; i<formData.length; i++) {
                        if(formData[i].value==''){
                            warnInfo("成果分类或描述信息不能为空");
                            return false;
                        }
                    }
                    return true;
                },
                // 请求成功时执行的回调函数
                success: function(data, status, xhr) {
                    if(checkData(data)) {
                        successInfo("修改成功");
                        $("#achievement").val("");
                        $("#detail").val("");
                    }
                }
            };
            $("#ajForm").ajaxForm(options);

            var aid=$.getUrlParam('aid');

            $.post(mainurl+"admin/getAchievement",{aid:aid},function (data) {
                $("#aid").val(data.data.aid);
                $("#achievement").val(data.data.achievement);
                $("#detail").val(data.data.detail);
            });

        });




    </script>
</head>
<body>
<p class="p1">所在位置：<a href="ClassificalOfResult.html?pageno=1" style="text-decoration: none;color: black;">成果分类信息</a>·修改</p>
<div class="div_form">
    <fieldset>
        <legend>修改</legend>
        <form class="fm" enctype="multipart/form-data" id="ajForm">
            <input   id="aid" name="aid" type="hidden">
            <label>成果分类:</label><input class="ipt" id="achievement" name="achievement" type="text">
            <br/>
            <label>描述:</label><textarea rows="6" name="detail" id="detail" style="width: 300px;"></textarea>
            <!--<button id="btn">提交</button>-->
            <input type="submit"  id="btn"  class="btn" id="btn_submit" value="确认修改"/>
        </form>
    </fieldset>
</div>
</body>
</html>